package com.dqx.haoqiu.mvp.module.user;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dqx.haoqiu.mvp.R;
import com.dqx.haoqiu.repository.entity.NewsEntity;

public class NewsAdapter extends BaseQuickAdapter<NewsEntity, BaseViewHolder> {

    public NewsAdapter() {
        super(R.layout.item_news);
    }

    @Override
    protected void convert(BaseViewHolder helper, NewsEntity item) {
        helper.setText(R.id.tv_title, item.getTitle());
        helper.setText(R.id.tv_view, "流量量：" + item.getView());
        Glide.with(mContext)
                .load(item.getImageUrl())
                .error(R.mipmap.ic_launcher)
                .into((ImageView) helper.getView(R.id.iv_image));
    }

}
